home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Netware Super Library
/
Netware Super Library.iso
/
mis_cnvt
/
txt2db
/
read.me
< prev
next >
Wrap
Text File
|
1994-01-05
|
8KB
|
176 lines
TXT2DBF Version 1.4
Copyright (c) BITwise Computer Services, 1992-1994
All rights reserved.
OVERVIEW:
---------
TXT2DBF is a data conversion program that may be used to convert ASCII text
files into database files. Some possible uses of TXT2DBF include converting
data files from a mainframe computer to a PC and converting formated report
files into useful databases.
"Why don't you just use the dBase APPEND FROM ... SDF command ?" you may ask.
Well there are several reasons why TXT2DBF is better in many situations:
1) You may not have dBase or FoxPro handy
2) You may want to do more formatting or conversion than is possible
with APPEND FROM ... SDF
3) You might not want all of the data in the text file
4) You may want to append data into an existing database that is not
in the same format as the text file
5) You can run TXT2DBF from a batch file for automated procedures
The power of TXT2DBF lies in the conversion script Files (.T2D) that
specify how the text information is extracted and formatted for the .DBF
output file. Take a look at the sample TEST.T2D to get an idea of what a
script looks like. Basically, you specify the file structure of the output
.DBF file along with standard Clipper expressions to retrieve and format
the text data. Below is a sample script file for a simple 3 field file.
ACCOUNT |C| 7| 0| SUBSTR(cRec,1,7)
AMOUNT |N| 9| 0| VAL(SUBSTR(cRec,8,9))
DATE |D| 8| 0| CTOD(SUBSTR(cRec,17,8))
As you can see, you merely specify the field name, type, length, and decimals,
along with the expression to retrieve/format the text data. You can create
any database structure you desire, including memo fields, as long as it adheres
to the specifications of the RDD. In the expression, you assume that the
variable "cRec" contains one record from the text file. Refer to the sample
script file TEST.T2D for more detail.
The script may also contain Filter Expressions that may be used to limit which
records get appended into the output database. Sample uses of filter
expressions include:
1) May be used to skip report headers and footers if the source file
is a formatted report.
2) May be used to filter records based on a field value.
3) May be used to skip blank lines, subtotals, etc..
As you can see, this GREATLY increases the usefulness of the program. Please
refer to the sample script file TEST.T2D for more detail.
Since YOU specify how to extract the data, you can skip any data you don't need,
format/convert the data to your heart's content, insert data not found in the
source text file, etc.. To do this kind of formatting with dBase would require
many MODIFIY STRUCTURE and REPLACE passes through the database - TXT2DBF
does it in a single pass!
PACKING LIST:
-------------
The following files should be included in the distribution
ZIP file TXT2DB14.ZIP:
READ.ME - You're looking at it
TXT2DBF.EXE - The executable
TEST.BAT - Sample batch file to test TXT2DBF
TEST.T2D - Sample conversion script file
TEST.TXT - Sample source file
MAKE.BAT - Make script for use with Blinker
TXT2DBF.OBJ - Object module for linking
TXT2DBF.CH - Header file
RDDSYS.PRG - Source file to define RDD system (DBFNTX)
VALIMPDC.PRG - Source for B_VALIMPDEC()
CDATE2DT.PRG - Source for B_CDATE2DT()
NTHAT.PRG - Source for B_NTHAT() and B_NTHRAT()
TXT2DBF.BL - Blinker link script
TXT2DBF.RL - RTLink link script
SIXCDX.ZIP - Contains rddsys.prg, txt2dbf.bl, and txt2dbf.rl modified
to use the SIXCDX RDD
Please note: The only file required to run the program is TXT2DBF.EXE
- place this file in your path.
RUNNING THE PROGRAM:
--------------------
To run the program you must specify the source file, destination file, and
script file:
Example: TXT2DBF test.txt test[.dbf] test[.t2d] [options]
The .DBF file will be created if neccessary. If the .DBF file already exists,
the structure will be compared to that in the script file to make sure that the
file is compatible, then records will be appended into the existing file.
The program assumes a default extension of .DBF for the destination file and
an extension of .T2D for the script file.
Command line options:
/s - syntax check only
The specified script file will be processed for syntax errors but no
conversion processing will take place. This is useful while debugging a
new script file or changes.
/i - ignore expression errors
Normally you wouldn't want to use this option as it can cause a fatal
runtime error. This option is primarily intended for registered users that
are modifying the program to allow the use of external functions in script
expressions.
/b:<size> - text record buffer size
This option sets the maximum record length for the script and source text
files. The default value is 1024 bytes and should be adequate for most uses.
The longest record in either text file including the CRLF (carraige return/
line feed) MUST NOT exceed this value otherwise processing will stop.
For example: If you are processing an 80 column report, a noticable
performance gain will be realized if you use a buffer size of 100 rather
than the default of 1024, especially when processing a very lengthy report.
Please note, however, that you need to allow for embedded printer codes,
control characters, etc.. when deciding on a buffer size.
NOTE: Multiple options MUST be seperated with spaces.
TECHNICAL DEPARTMENT:
---------------------
TXT2DBF was written in CA-Clipper 5.01 and later ported to CA-Clipper 5.2 to
take advantage of some of the new features - primarily the RDD support. The
program relies very heavily on CA-Clipper's low-level file system,
multi-dimensional arrays, and codeblock evaluation.
Modifying the program:
The shareware release contains the link scripts and source code for some sample
conversion functions. You can enhance the program by writing and linking in
your own conversion functions. You can specify a different RDD to support
multiple database formats. You can also modify the link script to tune the
program for speed or memory savings. You CANNOT, however, modify the main
parsing and conversion engine (TXT2DBF.OBJ). If you register the program for
$25.00 or more (hint, hint) you will receive the main code to TXT2DBF and you
can modify it to your heart's content.
SOFTWARE LICENSE:
-----------------
TXT2DBF is being distributed under the shareware concept. You are free to
distribute the software for evaluation purposes only, provided that you ONLY
distribute the original ZIP file TXT2DB14.ZIP without alteration. You are
licensed to use the software for a FREE 30 day trial period. After the 30 day
trial period has expired, you can do one of 3 things:
1) Register the software for $15 and receive a registered version on
diskette and future upgrade notices. $25 will get you the same PLUS
the source code and 1 free upgrade on diskette.
2) Stop using the software and destroy all copies of the software that
you may have.
3) Continue to use the software without regard for my rights or for the
rights of my hungry child or my spouse that is nagging me at this very
moment for spending so much time writing a program that I probably wont
make any money out of anyway.
Please make check or money order out to:
David Christian DBA BITwise Computer Services.
Mail to:
David Christian
BITwise Computer Services
PO Box 97642
Raleigh, NC 27624-7642